package com.wanlian.encrypt;

import java.io.UnsupportedEncodingException;

import org.apache.commons.codec.binary.Base64;

public class Base64Utils {
    public static String encode(byte[] binaryData) throws UnsupportedEncodingException {
        return new String(Base64.encodeBase64(binaryData), "UTF-8");
    }

    public static byte[] decode(String base64String) throws UnsupportedEncodingException {
        return Base64.decodeBase64(base64String.getBytes("UTF-8"));
    }
}
